package com.luanhj.framework.tenant.properties;

import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.stereotype.Component;

import java.util.Arrays;
import java.util.List;

/**
 * @author luanhj
 * @date 2025/6/3 15:47
 * @description 多租户配置属性
 **/
@Component
@ConfigurationProperties(prefix = "ruoyi.tenant")
public class TenantProperties {
    /**
     * 是否启用多租户功能
     */
    private boolean enabled = true;

    /**
     * 忽略租户条件的表名列表
     */
    private List<String> ignoreTables = Arrays.asList("tenant");

    /**
     * 租户字段名，默认 tenant_id
     */
    private String tenantIdColumn = "tenant_id";

    public boolean isEnabled() {
        return enabled;
    }

    public void setEnabled(boolean enabled) {
        this.enabled = enabled;
    }

    public List<String> getIgnoreTables() {
        return ignoreTables;
    }

    public void setIgnoreTables(List<String> ignoreTables) {
        this.ignoreTables = ignoreTables;
    }

    public String getTenantIdColumn() {
        return tenantIdColumn;
    }

    public void setTenantIdColumn(String tenantIdColumn) {
        this.tenantIdColumn = tenantIdColumn;
    }
}
